#include "threadPool.h"
int tidArrInit(tidArr_t * ptidArr, int workerNum){
    ptidArr->workerNum = workerNum; 
    ptidArr->arr = (pthread_t *)malloc(workerNum * sizeof(pthread_t));
    return 0;
}
//ls向客户端返回的字符串
int lsReturnData(fileList_t file_list,char **return_data){
    printf("lsReturnData");
    int file_number = file_list.file_number;
    char oneShot[4096] = {0};
    sprintf(*return_data, "%s%d","size:",file_number); 
    printf("%d\n",file_number);
    for(int i=0;i<file_number;i++){
        printf("%d\n",file_number);
        bzero(oneShot,sizeof(oneShot));
        sprintf(oneShot, "{%s:%s,%s:%d,%s:%d,%s:%ld}","dir_name",file_list.file_elem[i].dir_name,"dir_category",
            file_list.file_elem[i].dir_category,"dir_size",file_list.file_elem[i].dir_size,"last_modify_time",
            file_list.file_elem[i].last_modify_time); 
        strcat(*return_data,oneShot);
    }

    return 0;
}